<!DOCTYPE html>
<html lang="en">
<head>
  <title>个人信息详情</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  <meta name="apple-mobile-web-app-capable" content="yes"/>
  <link href="resources/resources/css/jquery-ui-themes.css" type="text/css" rel="stylesheet"/>
  <link href="resources/resources/css/axure_rp_page.css" type="text/css" rel="stylesheet"/>
  <link href="resources/data/styles.css" type="text/css" rel="stylesheet"/>
  <link href="resources/files/个人信息/styles.css" type="text/css" rel="stylesheet"/>
  <script src="resources/resources/scripts/jquery-1.7.1.min.js"></script>
  <script src="resources/resources/scripts/jquery-ui-1.8.10.custom.min.js"></script>
  <style>
          #u85_img {
            border-width:0px;
            position:absolute;
            left:70px;
            top:0px;
            width:151px;
            height:113px;
          }
          #u109_input {
            position:absolute;
            left:0px;
            top:0px;
            width:103px;
            height:25px;
            font-family:'Arial Normal', 'Arial';
            font-weight:400;
            font-style:normal;
            font-size:13px;
            text-decoration:none;
            color:#000000;
          }
          #u116_input {
            position:absolute;
            left:0px;
            top:0px;
            width:100px;
            height:25px;
            font-family:'Arial Normal', 'Arial';
            font-weight:400;
            font-style:normal;
            font-size:13px;
            text-decoration:none;
            color:#000000;
          }
          #u110_input {
            position:absolute;
            left:0px;
            top:0px;
            width:105px;
            height:25px;
            font-family:'Arial Normal', 'Arial';
            font-weight:400;
            font-style:normal;
            font-size:13px;
            text-decoration:none;
            color:#000000;
          }
          #u115_input {
            position:absolute;
            left:-5px;
            top:0px;
            width:105px;
            height:25px;
            font-family:'Arial Normal', 'Arial';
            font-weight:400;
            font-style:normal;
            font-size:13px;
            text-decoration:none;
            color:#000000;
          }
          #u111_input {
            position:absolute;
            left:0px;
            top:0px;
            width:120px;
            height:25px;
            font-family:'Arial Normal', 'Arial';
            font-weight:400;
            font-style:normal;
            font-size:13px;
            text-decoration:none;
            color:#000000;
          }
          #u114_input {
            position:absolute;
            left:0px;
            top:0px;
            width:118px;
            height:25px;
            font-family:'Arial Normal', 'Arial';
            font-weight:400;
            font-style:normal;
            font-size:13px;
            text-decoration:none;
            color:#000000;
          }
          #u112_input {
            position:absolute;
            left:0px;
            top:0px;
            width:120px;
            height:25px;
            font-family:'Arial Normal', 'Arial';
            font-weight:400;
            font-style:normal;
            font-size:13px;
            text-decoration:none;
            color:#000000;
          }
          #u113_input {
            position:absolute;
            left:-3px;
            top:0px;
            width:120px;
            height:25px;
            font-family:'Arial Normal', 'Arial';
            font-weight:400;
            font-style:normal;
            font-size:13px;
            text-decoration:none;
            color:#000000;
          }
          #u108 {
            border-width:0px;
            position:absolute;
            left:654px;
            top:401px;
            width:80px;
            height:25px;
          }
          #u77 {
            border-width:0px;
            position:absolute;
            left:654px;
            top:436px;
            width:80px;
            height:25px;
          }
          #u108_input {
            position:absolute;
            left:0px;
            top:0px;
            width:80px;
            height:25px;
            font-family:'Arial Normal', 'Arial';
            font-weight:400;
            font-style:normal;
            font-size:13px;
            text-decoration:none;
            color:#000000;
            text-align:left;
          }
          #u77_input {
            position:absolute;
            left:0px;
            top:0px;
            width:80px;
            height:25px;
            font-family:'Arial Normal', 'Arial';
            font-weight:400;
            font-style:normal;
            font-size:13px;
            text-decoration:none;
            color:#000000;
            text-align:left;
          }
          #head{
            z-index: 100;
            opacity: 100%;
          }
          #personalInformation{
              position:relative;
              top: -200px;
              z-index: -1000;
          }
      </style>
</head>
<body>
    <div id="head" style="height: 200px">
    <!-- Unnamed (矩形) -->
                <div id="u29" class="ax_default box_1">
                    <div id="u29_div" class=""></div>
                    <div id="u29_text" class="text ">
                        <p><span>流动人口服务管理系统</span></p>
                    </div>
                </div>

                <!-- Unnamed (矩形) -->
                <div id="u30" class="ax_default box_1">
                    <div id="u30_div" class=""></div>
                    <div id="u30_text" class="text ">
                        <p><span>个人信息</span></p>
                    </div>
                </div>

                <!-- Unnamed (矩形) -->
                <div id="u171" class="ax_default box_1">
                    <div id="u171_div" class=""></div>
                    <div id="u171_text" class="text ">
                        <p><span>配偶信息</span></p>
                    </div>
                </div>

                <!-- Unnamed (矩形) -->
                <div id="u31" class="ax_default box_1">
                    <div id="u31_div" class=""></div>
                    <div id="u31_text" class="text ">
                        <p><span>同住家庭成员</span></p>
                    </div>
                </div>

                <!-- Unnamed (矩形) -->
                <div id="u32" class="ax_default box_1">
                    <div id="u32_div" class=""></div>
                    <div id="u32_text" class="text ">
                        <p><span>计生信息</span></p>
                    </div>
                </div>


                <!-- Unnamed (矩形) -->
                <div id="u172" class="ax_default box_1">
                    <div id="u172_div" class=""></div>
                    <div id="u172_text" class="text ">
                        <p><span>就业信息</span></p>
                    </div>
                </div>

                <!-- Unnamed (矩形) -->
                <div id="u81" class="ax_default box_1">
                    <div id="u81_div" class=""></div>
                    <div id="u81_text" class="text ">
                        <p><span>居住信息</span></p>
                    </div>
                </div>
          </div>
    <iframe name="personalInformation" id="personalInformation" src=""  height="1200" width="2000" frameborder="0" ></iframe>
</body>
<script>
    $(function() {
        var id = window.location.href.split("id=")[1];
        var employmentMessageId = "";
        var dwellMessageId = "";
        var planingId = "";
        var spouse = "";
        var provinceCode = "";
        $.ajax({
            url:"/findPersonalMessageById",
            data:{id:id},
            dataType:"json",
            type:"post",
            async:false,
            success:function(data) {
                employmentMessageId = data.employmentMessageId;
                dwellMessageId = data.dwellMessageId;
                planingId = data.familyPlanningId;
                spouse = data.spouse;
                provinceCode = data.nowInProvince;
            }
        })
        $("#personalInformation").attr("src","/toPersonalInformation?id="+id);
        $("#personalInformation").load(function() {
            $("#personalInformation").contents().find("#u173").css("display","none");
            //配偶
          $("#u171").click(function() {
              if(spouse==undefined){
                $("#personalInformation").attr("src","/toSpouse?personalId="+id);
              }else {
                $("#personalInformation").attr("src","/toSpouse?personalId="+id+"&spouse="+spouse);
              }
              $("#u171_div").css("background-color",'rgba(102, 102, 255, 1)');
              $("#u30_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u31_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u32_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u81_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u172_div").css("background-color",'rgba(255, 255, 255, 1)');
              // window.personalInformation.toSpouse();调用子页面方法
              $("#personalInformation").load(function() {
                $("#personalInformation").contents().find("#u329").css("display","none");//修改子页面元素属性
                $("#personalInformation").contents().find("#u335").css("display","none");
              })
              // $("#personalInformation").contains("#");



          })
          //计生
          $("#u32").click(function() {
              if(planingId==undefined){
                $("#personalInformation").attr("src","/toFamilyPlanning?personalId="+id+"&provinceCode="+provinceCode)
              }else {
                $("#personalInformation").attr("src","/toFamilyPlanning?personalId="+id+"&provinceCode="+provinceCode+"&planingId="+planingId)
              }
              $("#u32_div").css("background-color",'rgba(102, 102, 255, 1)');
              $("#u172_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u81_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u30_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u31_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u171_div").css("background-color",'rgba(255, 255, 255, 1)');
              // window.personalInformation.toFamilyPlanning();
              $("#personalInformation").load(function() {
                $("#personalInformation").contents().find("#u480").css("display","none");
                $("#personalInformation").contents().find("#u486").css("display","none");
              })
          })
          //就业
          $("#u172").click(function() {
              if(employmentMessageId==undefined){
                $("#personalInformation").attr("src","/toEmploymentInformation?personalId="+id+"&provinceCode="+provinceCode)
              }else {
                $("#personalInformation").attr("src","/toEmploymentInformation?personalId="+id+"&provinceCode="+provinceCode+"&employmentMessageId="+employmentMessageId)
              }
              $("#u172_div").css("background-color",'rgba(102, 102, 255, 1)');
              $("#u81_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u30_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u31_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u171_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u32_div").css("background-color",'rgba(255, 255, 255, 1)');
              // window.personalInformation.toEmploymentInformation();
              $("#personalInformation").load(function() {
                $("#personalInformation").contents().find("#u522").css("display","none");
                $("#personalInformation").contents().find("#u494").css("display","none");
                $("#personalInformation").contents().find("#u583").css("display","none");
              })
          })
          //居住
          $("#u81").click(function() {
              if(dwellMessageId==undefined){
                  $("#personalInformation").attr("src","/toDwellMessage?personalId="+id+"&provinceCode="+provinceCode)
              }else {
                  $("#personalInformation").attr("src","/toDwellMessage?personalId="+id+"&provinceCode="+provinceCode+"&dwellMessageId="+dwellMessageId)
              }
              $("#u81_div").css("background-color",'rgba(102, 102, 255, 1)');
              $("#u30_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u31_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u171_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u172_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u32_div").css("background-color",'rgba(255, 255, 255, 1)');
              // window.personalInformation.toDwellMessage();
              $("#personalInformation").load(function() {
                $("#personalInformation").contents().find("#u681").css("display","none");
                $("#personalInformation").contents().find("#u591").css("display","none");
                $("#personalInformation").contents().find("#u677").css("display","none");
              })
          })
          //个人
          $("#u30").click(function() {
              $("#personalInformation").attr("src","/toPersonalInformation?id="+id);
              $("#u30_div").css("background-color",'rgba(102, 102, 255, 1)');
              $("#u31_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u171_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u172_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u32_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#u81_div").css("background-color",'rgba(255, 255, 255, 1)');

              $("#personalInformation").load(function() {
                  $("#personalInformation").contents().find("#u173").css("display","none");
              })
          })
          //同住家庭
          $("#u31").click(function() {
              $("#personalInformation").attr("src","/toFamilyMember?personalId="+id);
               $("#u31_div").css("background-color",'rgba(102, 102, 255, 1)');
               $("#u171_div").css("background-color",'rgba(255, 255, 255, 1)');
               $("#u30_div").css("background-color",'rgba(255, 255, 255, 1)');
               $("#u32_div").css("background-color",'rgba(255, 255, 255, 1)');
               $("#u81_div").css("background-color",'rgba(255, 255, 255, 1)');
               $("#u30_div").css("background-color",'rgba(255, 255, 255, 1)');
              $("#personalInformation").load(function() {
                $("#personalInformation").contents().find("#u403").css("display","none");
                $("#personalInformation").contents().find("#u342").css("display","none");
                $("#personalInformation").contents().find("#u409").css("display","none");
                $("#personalInformation").contents().find("#u410").css("display","none");
              })
          })
        })
    })
    function findPersonalMessageById(id) {
        $.ajax({
            url:"/findPersonalMessageById",
            data:{id:id},
            dataType:"json",
            type:"post",
            async:false,
            success:function(data) {
                var identifiedArr = new Array();
                for (var i = 1;i <= data.identified.length;i++){
                    identifiedArr.push(data.identified.substring(i-1,i))
                }
                $.each($(".identified"),function(index,item) {
                    $(item).val(identifiedArr[index]);
                })
                $("input[name='name']").val(data.name);
                $("input[name='formerName']").val(data.formerName);
                $("select[name='sex']").val(data.sex);
                var date = new Date(data.comeTime);
                var month = ("0"+(date.getMonth()+1)).slice(-2);
                var day = ("0"+date.getDate()).slice(-2);
                $("input[name='comeTimeStr']").val((date.getFullYear()+"-"+(month)+"-"+(day)));
                loadAllNation();
                $("select[name='nationalId']").val(data.nationalId);
                loadAllProvince();
                $("select[name='householdRegistrationProvince']").val(data.householdRegistrationProvince);
                loadOldCityByProvince();
                $("select[name='householdRegistrationCity']").val(data.householdRegistrationCity);
                loadOldCountyByCity();
                $("select[name='householdRegistrationCounty']").val(data.householdRegistrationCounty);
                loadOldTownshipByCounty();
                $("select[name='householdRegistrationTownship']").val(data.householdRegistrationTownship);
                $("input[name='householdRegistrationVillage']").val(data.householdRegistrationVillage);
                $("select[name='nowInProvince']").val(data.nowInProvince);
                loadNowCityByProvince();
                $("select[name='nowInCity']").val(data.nowInCity);
                loadNowCountyByCity();
                $("select[name='nowInCounty']").val(data.nowInCounty);
                loadNowTownshipByCounty();
                $("select[name='nowInTownship']").val(data.nowInTownship);
                $("input[name='nowInVillage']").val(data.nowInVillage);
                $("input[name='detailedAddress']").val(data.detailedAddress);
                $.each($("input[name='educationLevel']"),function(index,item) {//遍历单选框
                    if($(item).val()==data.educationLevel){//如果为要选的值
                        $(item).attr("checked","checked");//赋值
                    }
                })
                $("input[name='personalLandline']").val(data.personalLandline);
                $("input[name='personalMobilePhone']").val(data.detailedAddress);
                $("input[name='contactName']").val(data.personalLandline);
                $("input[name='contactLandline']").val(data.contactLandline);
                $("input[name='contactMobilePhone']").val(data.contactMobilePhone);
                $.each($("input[name='healthyState']"),function(index,item) {//遍历单选框
                    if($(item).val()==data.healthyState){//如果为要选的值
                        $(item).attr("checked","checked");//赋值
                    }
                })
                $.each($("input[name='politicalLandscape']"),function(index,item) {//遍历单选框
                    if($(item).val()==data.politicalLandscape){//如果为要选的值
                        $(item).attr("checked","checked");//赋值
                    }
                })
                $.each($("input[name='religiousBeliefs']"),function(index,item) {//遍历单选框
                    if($(item).val()==data.religiousBeliefs){//如果为要选的值
                        $(item).attr("checked","checked");//赋值
                    }
                })
                $.each($("input[name='bloodType']"),function(index,item) {//遍历单选框
                    if($(item).val()==data.bloodType){//如果为要选的值
                        $(item).attr("checked","checked");//赋值
                    }
                })
                $.each($("input[name='workingConditions']"),function(index,item) {//遍历单选框
                    if($(item).val()==data.workingConditions){//如果为要选的值
                        $(item).attr("checked","checked");//赋值
                    }
                })
                $.each($("input[name='maritalStatus']"),function(index,item) {//遍历单选框
                    if($(item).val()==data.maritalStatus){//如果为要选的值
                        $(item).attr("checked","checked");//赋值
                    }
                })
                $("#id").val(data.id);
                $("#employment_message_id").val(data.employmentMessageId);
                $("#spouse").val(data.spouse);
                $("#dwell_message_id").val(data.dwellMessageId);
            }
        })
    }
    function loadAllNation() {
        $.ajax({
            url:"/loadAllNation",
            dataType:"json",
            type:"post",
            async:false,
            success:function(data) {
                var html = "<option value='0' >请选择：</option>";
                var nation = $(".nationalId");
                nation.empty();
                $.each(data,function(index,item) {
                    html+="<option value='"+item.id+"' >"+item.name+"</option>";
                })
                nation.append(html)
            }
        })
    }
    function loadOldTownshipByCounty() {
        var county = $(".householdRegistrationCounty").val();
        $.ajax({
            url:"/loadNowTownshipByCounty",
            dataType:"json",
            data:{county:county},
            type:"post",
            async:false,
            success:function(data) {
                var township = $(".householdRegistrationTownship");
                township.empty();
                var html = "<option value='0' >请选择镇：</option>";
                $.each(data,function(index,item) {
                    html+="<option value='"+item.code+"' >"+item.name+"</option>"
                });
                township.append(html);
            }
        })
    }
    function loadOldCountyByCity() {
        var city = $(".householdRegistrationCity").val();
        $.ajax({
            url:"/loadNowCountyByCity",
            dataType:"json",
            data:{city:city},
            type:"post",
            async:false,
            success:function(data) {
                var county = $(".householdRegistrationCounty");
                county.empty();
                var html = "<option value='0' >请选择区：</option>";
                $.each(data,function(index,item) {
                    html+="<option value='"+item.code+"' >"+item.name+"</option>"
                });
                county.append(html);
            }
        })
    }
    function loadOldCityByProvince() {
        var province = $(".householdRegistrationProvince").val();
        $.ajax({
            url:"/loadNowCityByProvince",
            dataType:"json",
            data:{province:province},
            type:"post",
            async:false,
            success:function(data) {
                var city = $(".householdRegistrationCity");
                city.empty();
                var html = "<option value='0' >请选择市：</option>";
                $.each(data,function(index,item) {
                    html+="<option value='"+item.code+"' >"+item.name+"</option>"
                });
                city.append(html);
            }
        })
    }
    function loadNowTownshipByCounty() {
        var county = $(".nowInCounty").val();
        $.ajax({
            url:"/loadNowTownshipByCounty",
            dataType:"json",
            data:{county:county},
            type:"post",
            async:false,
            success:function(data) {
                var township = $(".nowInTownship");
                township.empty();
                var html = "<option value='0' >请选择镇：</option>";
                $.each(data,function(index,item) {
                    html+="<option value='"+item.code+"' >"+item.name+"</option>"
                });
                township.append(html);
            }
        })
    }
    function loadNowCountyByCity() {
        var city = $(".nowInCity").val();
        $.ajax({
            url:"/loadNowCountyByCity",
            dataType:"json",
            data:{city:city},
            type:"post",
            async:false,
            success:function(data) {
                var county = $(".nowInCounty");
                county.empty();
                var html = "<option value='0' >请选择区：</option>";
                $.each(data,function(index,item) {
                    html+="<option value='"+item.code+"' >"+item.name+"</option>"
                });
                county.append(html);
            }
        })
    }
    function loadNowCityByProvince() {
        var province = $(".nowInProvince").val();
        $.ajax({
            url:"/loadNowCityByProvince",
            dataType:"json",
            data:{province:province},
            type:"post",
            async:false,
            success:function(data) {
                var city = $(".nowInCity");
                city.empty();
                var html = "<option value='0' >请选择市：</option>";
                $.each(data,function(index,item) {
                    html+="<option value='"+item.code+"' >"+item.name+"</option>"
                });
                city.append(html);
            }
        })
    }
    function loadAllProvince() {
        $.ajax({
            url:"/loadAllProvince",
            dataType:"json",
            type:"post",
            async:false,
            success:function(data) {
                var provinceNow = $(".nowInProvince");
                var provinceOld = $(".householdRegistrationProvince");
                provinceNow.empty();
                provinceOld.empty();
                var html = "<option value='0' >请选择省：</option>";
                $.each(data,function(index,item) {
                    html+="<option value='"+item.code+"' >"+item.name+"</option>";
                });
                provinceOld.append(html);
                provinceNow.append(html);
            }
        });
    }

</script>
</html>